<?php
/**
 * Created by PhpStorm.
 * User: qishengqiang
 * Date: 2022-09-24
 * Time: 02:10
 */

namespace app\applet\controller;


use app\applet\BaseController;
use app\models\Linkers;
use GuzzleHttp\Client;

class LinkerController extends BaseController
{
    /**
     * 获取商品列表
     * @return \think\response\Json
     */
    public function listsAction()
    {
        try{
            $linkers = Linkers::select();

            if (count($linkers)) {
                foreach ($linkers as $linker) {
                    $data[] = [
                        'linkerId' => $linker->linkerId,
                        'linkerName' => $linker->linkerName,
                        'linkerAppId' => $linker->linkerAppId,
                        'linkerPath' => $linker->linkerPath,
                    ];
                }
            }

            return json(['code' => 200, 'msg' => '查询成功', 'data'=> $data]);
        }catch(\Exception $e){
            return json(['code' => $e->getCode(), 'msg' => $e->getMessage(), 'data'=> []]);
        }
    }
}